package com.example.yc23.demo.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.yc23.demo.mapper.FilmMapper;
import com.example.yc23.demo.mapper.FilmTypeMapper;
import com.example.yc23.demo.pojo.Film;
import com.example.yc23.demo.pojo.FilmType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.Map;
import java.util.function.Function;

@Service
public class FilmTypeService implements IService<FilmType> {
    @Autowired
    private FilmTypeMapper filmTypeMapper;

    @Override
    public BaseMapper<FilmType> getBaseMapper() {
        return filmTypeMapper;
    }

    public Film datas(String type){
        return filmTypeMapper.selectdata(type);
    }


    @Override
    public boolean saveBatch(Collection<FilmType> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean saveOrUpdateBatch(Collection<FilmType> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean updateBatchById(Collection<FilmType> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean saveOrUpdate(FilmType entity) {
        if (entity.getId()==null){
            return save(entity);
        }else{
            return updateById(entity);
        }
    }

    @Override
    public FilmType getOne(Wrapper<FilmType> queryWrapper, boolean throwEx) {
        return null;
    }

    @Override
    public Map<String, Object> getMap(Wrapper<FilmType> queryWrapper) {
        return null;
    }

    @Override
    public <V> V getObj(Wrapper<FilmType> queryWrapper, Function<? super Object, V> mapper) {
        return null;
    }



    @Override
    public Class<FilmType> getEntityClass() {
        return null;
    }
}
